package cn.wolfcode.trip.app.web.controller;

import cn.wolfcode.trip.base.service.IStrategyConcernService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/strategyConcerns")
public class StrategyConcernController {

    @Autowired
    private IStrategyConcernService strategyConcernService;

    @GetMapping("/{strategyId}")
    @ResponseBody
    public Object getLikerAndCollectorNums(@PathVariable Long strategyId){
        return strategyConcernService.getLikerAndCollectorNums(strategyId);
    }

    @PostMapping("/newLikerNums/{strategyId}/{likerId}")
    @ResponseBody
    public Object getNewLikerNums(@PathVariable Long strategyId,@PathVariable Long likerId){
        return strategyConcernService.insertAndGetNewLikerNums(strategyId,likerId);
    }
    @PostMapping("/newCollectorNums/{strategyId}/{collectorId}")
    @ResponseBody
    public Object getNewCollectorNums(@PathVariable Long strategyId,@PathVariable Long collectorId){
        return strategyConcernService.insertAndGetNewCollectorNums(strategyId,collectorId);
    }
}
